-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visual downwards move with big count goes to end of line and new configuration options #27
base: master
Are you sure you want to change the base?
Conversation
The lose of one column issue with 'virtualedit' wasn't related with the longest line as previously thought, but with the first line (smallest one) of selection, so changing it fixes now for real (hopefully) the bug of losing one column after moving. Using "range" in functions that didn't used visual selection was a problem when (a:firstline + count) greater than the last line so that range was deleted and replaced with <C-u> at the function calls. The name 'are_same_line' was really referring to a column, so it was renamed after 'are_same_cols' Create function to initialize configurations variables to its defaults.
The variable g:move_map_key can also be a dictionary to permit enabling/disabling of parts of the default mappings using the entries 'vertical' and 'horizontal' and its subentries 'normal' and 'visual'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still lost the first column and since I enabled listchars
I see another issue: in visual blocks with multiple lines and different line lengths, trailing spaces are inserted when shifting left and right.
plugin/move.vim
Outdated
@@ -79,6 +88,8 @@ function! s:MoveBlockLeft() range | |||
let l:distance = v:count ? v:count : 1 | |||
let l:min_col = min([col("'<"), col("'>")]) | |||
|
|||
" Having 'virtualenv' set to 'onemore' fixes problem of one more movement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Someone seems to write a lot of Python code as well ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't find a way to avoid inserting trailing spaces after a left/right move. But found that just removing the spaces after those operations is a possible solution. It is not exactly the same as not inserting them, because removing after an operation can also delete existing (possible wanted) spaces but this solution still will do right most times and could be configurable for those who don't want it.
The lose of one column issue with 'virtualedit' wasn't related with the
longest line as previously thought, but with the first line (smallest
one) of selection, so changing it fixes now for real (hopefully) the bug
of losing one column after moving.
Using "range" in functions that didn't used visual selection was a
problem when (a:firstline + count) greater than the last line so that
range was deleted and replaced with at the function calls.
The name 'are_same_line' was really referring to a column, so it was
renamed after 'are_same_cols'
Create function to initialize configurations variables to its defaults.
The variable g:move_map_key can also be a dictionary to permit
enabling/disabling of parts of the default mappings using the entries
'vertical' and 'horizontal' and its subentries 'normal' and 'visual'.